package com.kantboot.business.talent.repository;

import com.kantboot.business.talent.domain.entity.BusTalentSeriesWorkExperienceOfUserAccount;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface BusTalentSeriesWorkExperienceOfUserAccountRepository extends JpaRepository<BusTalentSeriesWorkExperienceOfUserAccount,Long> {

    /**
     * 根据用户账号ID删除
     */
    @Transactional
    @Modifying
    @Query("""
    DELETE FROM
    BusTalentSeriesWorkExperienceOfUserAccount bus
    WHERE
    bus.userAccountId = :userAccountId
    """)
    void deleteByUserAccountId(@Param("userAccountId") Long userAccountId);

}
